package cn.edu.ldu.protocol;

import cn.edu.ldu.entity.FriendsEntity;
import cn.edu.ldu.entity.UserAccountEntity;
import cn.edu.ldu.util.L;
import cn.edu.ldu.views.operator.AddFriends;
import com.alibaba.fastjson.JSONObject;

public class FriendResult {
    public FriendResult(Protocol protocol){
        UserAccountEntity friend = JSONObject.parseObject(protocol.getData(),UserAccountEntity.class);

        L.OK(friend, FriendResult.class);
        FriendsEntity fe = new FriendsEntity();
        fe.setFriendId(friend.getUserId());
        fe.setUserAccountEntity(friend);
        new AddFriends(fe).setVisible(true);
    }
}
